using System;
using System.Collections.Generic;
using System.Text;
using MacomberMap.Common.User_Interfaces.Components;
using System.Data.Common;
using System.Xml;
using MacomberMap.Common.Types;

namespace MacomberMap.Common.Components
{
    /// <summary>
    /// This class holds information on an electrical bus
    /// </summary>
    [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.Both)]
    public class MM_ElectricalBus: MM_Element
    {
        #region Variable declarations
        /// <summary>The name associated with the electrical bus</summary>
        [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.TypeCollection)]
        public MM_Node AssociatedNode
        {
            get { return _AssociatedNode; }
            set { _AssociatedNode = value; }
        }
        private MM_Node _AssociatedNode;
        #endregion

        #region Initialization
        /// <summary>
        /// Initialize the electrical bus
        /// </summary>
        public MM_ElectricalBus()
            : base()
        {
            this.ElemType = MM_Overall_Display.ElemTypes["ElectricalBus"];
        }

        /// <summary>
        /// Initialize an electrical bus
        /// </summary>
        /// <param name="BusSource"></param>
        public MM_ElectricalBus(DbDataReader BusSource)
            : base(BusSource)
        {
            this.ElemType = MM_Overall_Display.ElemTypes["ElectricalBus"];
        }

        
        /// <summary>
        /// Initialize an electrical bus
        /// </summary>
        /// <param name="BusSource"></param>
        public MM_ElectricalBus(XmlElement BusSource)
            : base(BusSource)
        {
            this.ElemType = MM_Overall_Display.ElemTypes["ElectricalBus"];
        }
        #endregion
    }
}
